package com.googlecode.bip.entity;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * This is a values for a user/question/date
 */
public interface IUserValue extends Serializable
{
    /**
     * Returns iduser (see {@link IUser})
     * @return the iduser
     */
    public int getIdUser();

    /**
     * Set the user id
     * @param iduser The user id
     */
    public void setIdUser( int iduser );

    /**
     * Returns the idquestion (see {@link IQuestion})
     * @return the idquestion
     */
    public int getIdQuestion();

    /**
     * Set the id of the question
     * @param idquestion The id of the question
     */
    public void setIdQuestion( int idquestion );

    /**
     * Returns {@link Timestamp} for this value
     * @return the userdate
     */
    public Timestamp getUserDate();

    /**
     * Set {@link Timestamp} for this value
     * @param userdate the userdate to set
     */
    // REQUIRED for QuestionValue (JSON)
    public void setUserDate( Timestamp userdate );

    /**
     * Returns the uservalue
     * @return the uservalue or null if not define
     */
    public Integer getUserValue();

    /**
     * Set the value for this {@link IUser}, this {@link IQuestion} and
     * this {@link Timestamp}.
     * <p>
     * Value must be in a valid range according to {@link IQuestion#getMinValue()}
     * and {@link IQuestion#getMaxValue()}
     * </p>
     * @param uservalue the uservalue to set
     * @throws NullPointerException if uservalue is null.
     */
    public void setUserValue( Integer uservalue );

    /**
     * Returns optional user comment for this value
     * @return the usercomment, or null if no comment
     */
    public String getUserComment();

    /**
     * Set optional user comment for this value
     * @param usercomment the usercomment to set (could be null or empty : no comment)
     */
    public void setUserComment( String usercomment );

    /**
     * Returns true if user want to keep this answer private
     * @return true if user want to keep this answer private
     */
    public boolean isPrivate();

    /**
     * Define if user want to keep this answer private
     * @param isPrivate true if user want to keep this answer private
     */
    public void setPrivate( boolean isPrivate );
}
